package com.agou.core.enums;


public enum EnSex implements IEnum{
	 Woman("女", 0),Man("男", 1),Unknown("未知",2);
	// 成员变量
	private String enumName;
	private int enumCode;

	// 构造方法
	private EnSex(String name, int code) {
		this.enumName = name;
		this.enumCode = code;
	}

	public String getName() {
		return enumName;
	}

	public int getCode() {
		return enumCode;
	}

	// 普通方法
	public static String getEnumName(int code) {
		for (EnSex c : EnSex.values()) {
			if (c.getCode() == code) {
				return c.enumName;
			}
		}
		return null;
	}
	
	public static EnSex getEnum(int code) {
		for (EnSex c : EnSex.values()) {
			if (c.getCode() == code) {
				return c;
			}
		}
		return null;
	}
}
